package com.thoughtworks.recruit.test.jgraph.graph;

import com.thoughtworks.recruit.test.jgraph.interfaces.DiGraph;

/**
 * A default implementation for edges in a {@link DiGraph.WeightedGraph}. All access to the weight of an
 * edge must go through the graph interface, which is why this class doesn't expose any public
 * methods.
 *
 */
public class DefaultWeightedEdge
    extends DefaultEdge
{
    private static final long serialVersionUID = 1L;

    double weight = DiGraph.WeightedGraph.DEFAULT_EDGE_WEIGHT;

    /**
     * Retrieves the weight of this edge. This is protected, for use by subclasses only (e.g. for
     * implementing toString).
     *
     * @return weight of this edge
     */
    protected double getWeight()
    {
        return weight;
    }
}
